From: Florian Müllner Date: Tue, 17 Sep 2024 17:36:55 +0000 (+0200) Subject: status/system: Indicate "battery health" status X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~18 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4d0d86205df4338a3a1e8665b1493396323363cb;p=gnome-shell.git status/system: Indicate "battery health" status "Preserve battery health" is a new feature which limits battery charging in order to increase battery longevity. Currently when the charging limit is hit, the state is indistinguishable from the unplugged, discharging state, which isn't great: The user has no way to know whether the limit was reached, or they accidentally unplugged the device. To address this, use dedicated icons in the plugged-in- but-not-charging case. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5228 Part-of: --- diff --git a/data/dbus-interfaces/org.freedesktop.UPower.Device.xml b/data/dbus-interfaces/org.freedesktop.UPower.Device.xml index 488228505..503a62ebb 100644 --- a/data/dbus-interfaces/org.freedesktop.UPower.Device.xml +++ b/data/dbus-interfaces/org.freedesktop.UPower.Device.xml @@ -7,5 +7,6 @@ + diff --git a/js/ui/status/system.js b/js/ui/status/system.js index baebf21ef..a98d2e658 100644 --- a/js/ui/status/system.js +++ b/js/ui/status/system.js @@ -74,8 +74,15 @@ const PowerToggle = GObject.registerClass({ return; // The icons - let chargingState = this._proxy.State === UPower.DeviceState.CHARGING - ? '-charging' : ''; + let chargingState; + if (this._proxy.State === UPower.DeviceState.CHARGING) + chargingState = '-charging'; + else if (this._proxy.State === UPower.DeviceState.PENDING_CHARGE && + this._proxy.ChargeThresholdEnabled) + chargingState = '-plugged-in'; + else + chargingState = ''; + let fillLevel = 10 * Math.floor(this._proxy.Percentage / 10); const charged = this._proxy.State === UPower.DeviceState.FULLY_CHARGED ||